<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>函数把包含数据的二进制字符串转换为十六进制值</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.bin2hex" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">bin2hex</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">bin2hex</span> &mdash; <span class="dc-title">函数把包含数据的二进制字符串转换为十六进制值</span></p>

 </div>
 
  <div class="refsect1 description" id="refsect1-function.bin2hex-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>bin2hex</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$str</code></span>
   ) : <span class="type">string</span></div>

  <p class="para rdfs-comment">
   把二进制的参数
   <code class="parameter">str</code>
   转换为的十六进制的字符串。转换使用字节方式，高四位字节优先。
  </p>
 </div>

 
 <div class="refsect1 parameters" id="refsect1-function.bin2hex-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<code class="parameter">str</code></dt>

     <dd>

      <p class="para">
       二进制字符串。
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 
  <div class="refsect1 returnvalues" id="refsect1-function.bin2hex-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   返回指定字符串十六进制的表示。
  </p>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-function.bin2hex-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="hex2bin.html" class="function" rel="rdfs-seeAlso">hex2bin()</a> - 转换十六进制字符串为二进制字符串</span></li>
    <li class="member"><span class="function"><a href="pack.html" class="function" rel="rdfs-seeAlso">pack()</a> - 将数据打包成二进制字符串</span></li>
   </ul>
  </p>
 </div>

 
</div></div></div></body></html>